using System;
using System.Collections.Generic;
using System.Text;
using Danser_Entity.Entities;
using Danser_Entity.Queries.Filters;


namespace Danser_Control.Managers
{
    /// <summary>
    /// Handle Danser's validation templates mechanism the for imported tests to the persistance layer
    /// </summary>
    public interface IValidationManager
    {
        /// <summary>
        /// Creates a validation template
        /// </summary>
        /// <param name="templateName"></param>
        /// <param name="apliedOnDefault"></param>
        /// <param name="mailList"></param>
        /// <param name="ruleExpression"></param>
        /// <returns></returns>
        void CreateTemplate(string templateName, bool apliedOnDefault, String mailList, String ruleExpression);

        /// <summary>
        /// Creates a validation template
        /// </summary>
        /// <param name="validationTemplate"></param>
        void CreateTemplate(ValidationTemplate validationTemplate);

        /// <summary>
        /// Removes a template from the DB
        /// </summary>
        /// <param name="templateID"></param>
        void RemoveValidationTemplate(int templateID);

        /// <summary>
        /// Modifies selected template
        /// </summary>
        /// <param name="templateID"></param>
        /// <param name="MailList"></param>
        /// <param name="appliedOnDefault"></param>
        void ModifyTemplateDetails(int templateID, String MailList, bool appliedOnDefault);

        /// <summary>
        /// Gets all validation templates' entities according to the selected ids
        /// </summary>
        /// <param name="templateIds">list of selected ids. if null or empty - will retrieve all templates in DB</param>
        /// <returns>list of validation templates</returns>
        IList<ValidationTemplate> GetValidationTemplates(IList<int> templateIds);

        /// <summary>
        /// Gets all user entities satisfying the given condition 
        /// </summary>
        /// <param name="filter">
        /// SQL sentence for WHERE clause>
        /// </param>
        /// <returns>list of validation templates</returns>
        IList<ValidationTemplate> GetValidationTemplates(String filter);

        /// <summary>
        /// Gets test info for all the tests that failed this template
        /// </summary>
        /// <param name="validationTemplateID"></param>
        /// <returns></returns>
        List<TestInfo> GetFailedTestForTemplate(int validationTemplateID);

        /// <summary>
        /// Gets the templates tha the test had failed
        /// </summary>
        /// <param name="testInfoIndex"></param>
        /// <returns></returns>
        List<ValidationTemplate> GetFailingTemplatesForTest(String testInfoIndex);

    }
}
